import request from '@/utils/request'
import api from '@/utils/api'
// 加入购物车接口
export const addCartListAPI = ({ memberId, goodId, qty }) => {
  return api({
    url: '/cart-api/api/v1/carts',
    method: 'POST',
    data: {
      memberId,
      goodId,
      qty
    }
  })
}
// 获取购物车接口
export const getCartListAPI = (memberId) => {
  return api({
    url: '/cart-api/api/v1/carts',
    params: { memberId }
  })
}
// 删除购物车
// ids: [String]
export const deleteCartListAPI = (ids) => {
  return api({
    url: '/cart-api/api/v1/carts',
    method: 'DELETE',
    data: ids
  })
}
export const updateCartListAPI = ({ id, memberId, goodId, qty }) => {
  return api({
    url: '/cart-api/api/v1/carts',
    method: 'PUT',
    data: {
      id,
      memberId,
      goodId,
      qty
    }
  })
}
